package edu.bbu.commonproject.desktop.gui.view.swing.login;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.plaf.ButtonUI;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.MenuBarUI;
import javax.swing.plaf.MenuItemUI;
import javax.swing.plaf.basic.BasicButtonUI;
import javax.swing.plaf.basic.BasicCheckBoxMenuItemUI;
import javax.swing.plaf.basic.BasicMenuItemUI;

import edu.bbu.commonproject.desktop.gui.view.swing.utils.Design;

/**
 * The StartHeaderPanel class.
 * It contains the menubar and the StartLogoPanel.
 */
public class HeaderPanel extends JPanel
{
	/** The file menu. */
	private JMenu fileMenu;
	
	/** The help menu. */
	private JMenu helpMenu;
	
	/** The menu bar. */
	private JMenuBar jMenuBar;
	
	/** The login menu item. */
	private JMenuItem loginMenuItem;
	
	/** The register menu item. */
	private JMenuItem registerMenuItem;
	
	/** The forgoton password menu item. */
	private JMenuItem forgotPasswordMenuItem;
	
	/** The exit menu item. */
	private JMenuItem exitMenuItem;
	
	/** The help menu item. */
	private JMenuItem helpMenuItem;
	
	/** The baout menu item. */
	private JMenuItem aboutMenuItem;
	
	private LogoPanel startLogoPanel;
	
	/**
	 * The constructor.
	 */
	public HeaderPanel()
	{
		this.setLayout(new BorderLayout());
		
		setComponents();
	}
	
	/**
	 * Sets up the components.
	 */
	private void setComponents()
	{		
		jMenuBar = new JMenuBar();
		
		fileMenu = new JMenu("Application");
		helpMenu = new JMenu("Help");
		
		Design.setMenuSelectedLook(fileMenu);
		Design.setMenuSelectedLook(helpMenu);
		
		loginMenuItem = new JMenuItem("  Login", new ImageIcon(Design.MENU_LOGIN));
		registerMenuItem = new JMenuItem("  Register", new ImageIcon(Design.MENU_REGISTER));
		forgotPasswordMenuItem = new JMenuItem("  Forgot password", new ImageIcon(Design.MENU_FORGOT));
		exitMenuItem = new JMenuItem("  Exit", new ImageIcon(Design.MENU_CLOSE));
		helpMenuItem = new JMenuItem("  Help", new ImageIcon(Design.MENU_HELP));
		aboutMenuItem = new JMenuItem("  About", new ImageIcon(Design.MENU_ABOUT));
		
		Design.setMenuItemSelectedLook(registerMenuItem);
		Design.setMenuItemSelectedLook(loginMenuItem);
		Design.setMenuItemSelectedLook(forgotPasswordMenuItem);
		Design.setMenuItemSelectedLook(exitMenuItem);
		Design.setMenuItemSelectedLook(helpMenuItem);
		Design.setMenuItemSelectedLook(aboutMenuItem);
		
		fileMenu.add(loginMenuItem);
		fileMenu.add(registerMenuItem);
		fileMenu.add(forgotPasswordMenuItem);
		fileMenu.addSeparator();
		fileMenu.add(exitMenuItem);
		helpMenu.add(helpMenuItem);
		helpMenu.add(aboutMenuItem);
		
		jMenuBar.add(fileMenu);
		jMenuBar.add(helpMenu);
		
		startLogoPanel = new LogoPanel();
		
		this.add(jMenuBar, BorderLayout.NORTH);
		this.add(startLogoPanel, BorderLayout.CENTER);
	}
	
	/**
	 * Gets the start logo panel.
	 * @return the start logo panel.
	 */
	public LogoPanel getStartLogoPanel()
	{
		return startLogoPanel;
	}

	/**
	 * Gets the login menu item.
	 * @return the menu itme.
	 */
	public JMenuItem getLoginMenuItem()
	{
		return loginMenuItem;
	}
	
	/**
	 * Gets the registerm menu item.
	 * @return the menu item.
	 */
	public JMenuItem getRegisterMenuItem()
	{
		return registerMenuItem;
	}
	
	/**
	 * Gets the forgoton password menu item.
	 * @return
	 */
	public JMenuItem getForgotPasswordMenuItem()
	{
		return forgotPasswordMenuItem;
	}
	
	/**
	 * Gets the exit menu item.
	 * @return the exit menu item.
	 */
	public JMenuItem getExitMenuItem()
	{
		return exitMenuItem;
	}
	
	/**
	 * Gets the help menu item.
	 * @return the help menu item.
	 */
	public JMenuItem getHelpMenu()
	{
		return helpMenuItem;
	}
	
	/**
	 * Gets the about menu item.
	 * @return the about menu item.
	 */
	public JMenuItem getAboutMenuItem()
	{
		return aboutMenuItem;
	}
}
